#include "cpp_story.h"

struct FirstContext
{
    int value;
};

struct SecondContext
{
    int value;
};

struct ResultContext
{
    bool is_equal;
};

STEP_DEF("set value of first context to (\d+)")
{
    CONTEXT(FirstContext, f);
    REGEX_INT(v);
    f->value = v;
    return true;
}

STEP_DEF("set value of second context to (\d+)")
{
    CONTEXT(SecondContext, s);
    REGEX_INT(v);
    s->value = v;
    return true;
}

STEP_DEF("compare value of first/second context")
{
    CONTEXT(FirstContext, f);
    CONTEXT(SecondContext, s);
    CONTEXT(ResultContext, result);
    result->is_equal = (f->value == s->value);
    return true;
}

STEP_DEF("first value is equal to second value")
{
    CONTEXT(ResultContext, result);
    CHECK_EQUAL(true, result->is_equal);
    return true;
}

